import { ShopFields } from "@/interfaces/ShopEntity";
import { gql } from "@apollo/client";


export const SelShopListQuery = gql`
    query SelShopList($address:String,$order:String,$keyword:String){
        selShopList(address:$address,order:$order,keyword:$keyword){
             ${ShopFields}
        }
    }
`

export const AddShopMutation = gql`
    mutation AddShop(
        $avatar:String!,
        $name:String!,
        $threshold:Int,
        $total:Int,
        $information:String,
        $address:String!,
        $phone:String!,
        $businessHours:String!,
    ){
        addShop(
            avatar:$avatar,
            name:$name,
            threshold:$threshold,
            total:$total,
            information:$information,
            address:$address,
            phone:$phone,
            businessHours:$businessHours
        ){
            id
        }   
    }
`
export const DelShopMutation = gql`
    mutation DelShop($id:Int!){
        delShop(id:$id){
            id
        }
    }
`
export const UpdShopMutation = gql`
    mutation UpdShop(
        $avatar:String,
        $id:Int!,
        $name:String!,
        $threshold:Int,
        $total:Int,
        $information:String,
        $address:String!,
        $phone:String!,
        $businessHours:String!,
    ){
        updShop(
            avatar:$avatar,
            id:$id,
            name:$name,
            threshold:$threshold,
            total:$total,
            information:$information,
            address:$address,
            phone:$phone,
            businessHours:$businessHours
        ){
            id
        }   
    }
`